/*
 * @Author: 13212657520 10828485+zhaosieve@user.noreply.gitee.com~
 * @Date: 2022-05-24 16:15:30
 * @LastEditors: 13212657520 10828485+zhaosieve@user.noreply.gitee.com~
 * @LastEditTime: 2022-05-30 20:43:49
 * @FilePath: \vue-2202\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: () => import("../layout"),
    redirect: "/home",
    children: [
      {
        path: "/home",
        component: () => import("../views/home"),
        meta: {
          title: "首页",
          isShow: true,
          active: 0,
        },
      },
      {
        path: "/home/newslist",
        component: () => import("../views/news/newslist"),
        meta: {
          title: "新闻资讯",
          isShow: false,
        },
      },
      {
        path: "/home/newsinfo/:id",
        component: () => import("../views/news/newsinnfo"),
        props: true,
        meta: {
          title: "新闻详细",
          isShow: false,
        },
      },
      {
        path: "/friend",
        component: () => import("../views/friend"),
        meta: {
          title: "好友",
          isShow: true,
          active: 1,
        },
      },
      {
        path: "/cart",
        component: () => import("../views/cart"),
        meta: {
          title: "购物车",
          isShow: false,
          active: 2,
        },
      },
      {
        path: "/search",
        component: () => import("../views/search"),
        meta: {
          title: "搜索",
          isShow: true,
          active: 3,
        },
      },
      {
        path: "/home/photolist",
        component: () => import("../views/photos/photilist"),
        meta: {
          title: "图片列表",
          isShow: false,
        },
      },
      {
        path: "/home/goodslist",
        component: () => import("../views/shops/shoplist"),
        props: true,
        meta: {
          title: "商品列表",
          isShow: false,
        },
      },
      {
        path: "/home/goodsinfo/:id",
        component: () => import("../views/shops/shopinnfo"),
        props: true,
        meta: {
          title: "商品详情",
          isShow: false,
        },
      },
      {
        path: "/home/photoinfo/:id",
        component: () => import("../views/photos/photoinfo"),
        props: true,
        meta: {
          title: "图片详情",
          isShow: false,
        },
      },
    ],
  },
  {
    path: "*",
    component: () => import("../views/404"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
